package com.javen.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.javen.services.UserServiceImpl;

@Controller
@RequestMapping("/service")
public class UserController extends BaseController {
	@Autowired 
	private UserServiceImpl userServiceImpl;
	
	@RequestMapping(value = "/login",method = {RequestMethod.GET,RequestMethod.POST})
	public void  login(String account,String password,HttpServletRequest request ,HttpServletResponse response) {
		Map<String, Object> map = userServiceImpl.login(account, password);
        this.writeJson(map, response);
		
	}
	
//	/**
//  * 
//  * @param account
//  * @param password
//  * @param request
//  * @param response
//  */
//	@RequestMapping(value = "/login",method = {RequestMethod.GET,RequestMethod.POST})
//	public void login(String account,String password,HttpServletRequest request,HttpServletResponse response) {
//		 Map<String, Object> map = userServiceImpl.login(account, password);
//		 this.writeJson(map, response);
//	}
//	
//	
	
}
